package aos2;


public class ServerRequest extends Request implements Comparable<ServerRequest>{
	private int timeStamp;
	private int requestorId;
	private int seqNum;
	
	public void setTimeStamp(int timeStamp) {
		this.timeStamp = timeStamp;
	}
	public int getTimeStamp() {
		return timeStamp;
	}
	@Override
	public int compareTo(ServerRequest o) {
		if(this.timeStamp < o.timeStamp){
			return -1;
		}else if(this.timeStamp == o.timeStamp){
			if(this.requestorId < o.requestorId){
				return -1;
			}else{
				return 1;
			}
		}
		return 1;
		
	}
	public void setSeqNum(int seqNum) {
		this.seqNum = seqNum;
	}
	public int getSeqNum() {
		return seqNum;
	}
	
	public int getRequestorId() {
		return requestorId;
	}
	public void setRequestorId(int requestorId) {
		this.requestorId = requestorId;
	}
	@Override
	public String toString() {
		return super.toString() + ":" + this.timeStamp + ":" + this.seqNum + ":" + this.requestorId;
	}

}
